home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr50
/
qbmnus16.zip
/
HORZSAMP.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-03-14
|
2KB
|
63 lines
DECLARE SUB HorizontalMenu (tr%, bc%, fc%)
CLS
HorizontalMenu 1, 1, 7
' │ │ └───┐
' tr% └─fc% bc%
' ──────────────────────────────────────────
' Tr%:
' Location of row for first line of menu
' ──────────────────────────────────────────
' Fc%:
' Foreground color (Pick any color from 1 to 15)
' ──────────────────────────────────────────
' Bc%:
' Background color (Pick any color from 1 to 15)
' ──────────────────────────────────────────
SUB HorizontalMenu (tr%, bc%, fc%)
COLOR fc%, bc%
LOCATE tr%, 1: PRINT STRING$(80, 0)
'background for menu
LOCATE tr%, 1: PRINT SPACE$(3); "FILES"; SPACE$(5); "TOOLS"; SPACE$(5); "SCAN"; SPACE$(6); "KILL"; SPACE$(6); "NAME"; SPACE$(6); "LOOKUP"; SPACE$(4); "WRITE"; SPACE$(5); "EXIT"
'menu items and correct spacing
col = 4 ' preset of first menu item
DO
DO
SELECT CASE col
CASE 4: opt$ = "FILES" 'This section needed to reprint
CASE 14: opt$ = "TOOLS" 'menu items after widebar selector
CASE 24: opt$ = "SCAN" 'passes over them
CASE 34: opt$ = "KILL"
CASE 44: opt$ = "NAME"
CASE 54: opt$ = "LOOKUP"
CASE 64: opt$ = "WRITE"
CASE 74: opt$ = "EXIT"
END SELECT
LOCATE tr%, col, 0: COLOR bc%, fc%: PRINT opt$
'sets spacing of widebar selector
keys$ = INKEY$
LOOP WHILE keys$ = ""
keymove = ASC(RIGHT$(keys$, 1)) 'interprets scancodes
LOCATE tr%, col, 0: COLOR fc%, bc%: PRINT opt$
'resets menu items and color after widebar selector passes over them
SELECT CASE keymove
CASE 13
IF col = 4 THEN END
IF col = 14 THEN END 'edit out "END" and place in your own code
IF col = 24 THEN END 'to call subprograms, etc.
IF col = 34 THEN END
IF col = 44 THEN END
IF col = 54 THEN END
IF col = 64 THEN END
IF col = 74 THEN END
CASE 75: col = col - 10 'moves widebar selector ahead 10 cols
CASE 77: col = col + 10 'moves widebar selector back 10 cols
CASE 71: col = 74 'shortcut keys
CASE 79: col = 74 'shortcut keys
END SELECT
IF col < 4 THEN col = 74 ELSE IF col > 74 THEN col = 4 'limits range of widebar
LOOP
END
END SUB